package com.xiaomaoguai.jsontest;

import java.io.ByteArrayOutputStream;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.xiaomaoguai.springmvc.model.Student2;

/**
 * @Description :
 * @FileName: JsonViewTest1.java
 * @Author :WeiHui.Zhang
 * @Data : 2015年5月18日 上午9:53:25
 * @Version:V1.00
 */
public class JsonViewTest2 {

	public static void main(String[] args) throws Exception {
		ObjectMapper mapper = new ObjectMapper();
		Student2 student = new Student2(5, "zhangsan", "123456");
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		mapper.writerWithView(Student2.AllView.class).writeValue(bos, student);
		System.out.println(bos.toString());
	}
}
